package com.binance.notification.api;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.binance.master.configs.FeignConfig;
import com.binance.master.constant.Constant;
import com.binance.master.models.APIRequest;
import com.binance.master.models.APIResponse;
import com.binance.notification.api.request.LongIdRequest;
import com.binance.notification.api.request.MessagePushRequest;
import com.binance.notification.api.request.MessageTypeRequest;
import com.binance.notification.api.request.MessageUpdateRequest;
import com.binance.notification.api.response.MessagePushBodyPageResponse;
import com.binance.notification.api.response.MessagePushPageResponse;
import com.binance.notification.api.response.MessageTypePageResponse;
import com.binance.notification.api.response.MessageTypeResponse;
import com.binance.notification.api.vo.MessagePushVo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author lufei
 * @date 2018/11/2
 */
@FeignClient(name = Constant.NOTIFICATION_WEB_SERVICE, configuration = FeignConfig.class)
@Api(value = "创建审核发送消息到安卓、苹果、PC客户端和web应用", tags = "创建审核发送消息到安卓、苹果、PC客户端和web应用")
@RequestMapping(value = "/messagePush")
public interface MessagePushApi {

    @ApiOperation("添加消息类型")
    @PostMapping("/addType")
    APIResponse<Void> addType(@RequestBody APIRequest<MessageTypeRequest> request);

    @ApiOperation("修改消息类型")
    @PostMapping("/updateType")
    APIResponse<Void> updateType(@RequestBody APIRequest<MessageTypeRequest> request);

    @ApiOperation("删除消息类型")
    @PostMapping("/deleteType")
    APIResponse<Void> deleteType(@RequestBody @Validated APIRequest<LongIdRequest> request);

    @ApiOperation("获取消息类型")
    @PostMapping("/getTypeById")
    APIResponse<MessageTypeResponse> getTypeById(@RequestBody @Validated APIRequest<LongIdRequest> request);

    @ApiOperation("获取消息类型")
    @PostMapping("/getTypeList")
    APIResponse<MessageTypePageResponse> getTypeList(@RequestBody APIRequest<MessageTypeRequest> request);

    @ApiOperation("保存或者修改消息推送信息")
    @PostMapping("/saveOrUpdate")
    APIResponse<Void> saveOrUpdateMessagePush(@RequestBody @Validated APIRequest<MessagePushRequest> request);

    @ApiOperation("查询推送信息")
    @PostMapping("/getById")
    APIResponse<MessagePushVo> getById(@RequestBody APIRequest<LongIdRequest> request);

    @ApiOperation("查询推送信息")
    @PostMapping("/getList")
    APIResponse<MessagePushPageResponse> getList(@RequestBody APIRequest<MessagePushRequest> request);

    @ApiOperation("查询推送信息详情")
    @PostMapping("/getMessagePushBodyList")
    APIResponse<MessagePushBodyPageResponse> getMessagePushBodyList(@RequestBody APIRequest<LongIdRequest> request);

    @ApiOperation("拒绝")
    @PostMapping("/refuseNotice")
    APIResponse<Void> refuseNotice(@RequestBody @Validated APIRequest<MessageUpdateRequest> request);

    @ApiOperation("删除")
    @PostMapping("/delete")
    APIResponse<Void> delete(@RequestBody @Validated APIRequest<LongIdRequest> request);

    @ApiOperation("发送")
    @PostMapping("/send")
    APIResponse<Void> send(@RequestBody @Validated APIRequest<MessageUpdateRequest> request);

}
